package cn.wolfcode.trip.app.web.controller;

import cn.wolfcode.trip.base.domain.Hotel;
import cn.wolfcode.trip.base.query.HotelQueryObjext;
import cn.wolfcode.trip.base.service.IHotelService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 前台找酒店控制器
 */
@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private IHotelService service;


    //查询所有的酒店,用于高级查询
    @GetMapping
    public Object list(HotelQueryObjext qo) {
        PageInfo info = service.query(qo);
        return info;
    }

    //查询单个酒店,进行详情页展示
    @GetMapping("/{id}")
    public Object get(@PathVariable Long id) {
        return service.get(id);
    }


}
